//Model simple shaders

float4x4 proj;
float4x4 view;
float4x4 model;
Texture2D gDiffuseTexture;

RasterizerState SolidDraw
{
	FILLMODE = SOLID;
};

SamplerState MeshTextureSampler
{
    Filter = MIN_MAG_LINEAR_MIP_POINT;
    AddressU = Wrap;
    AddressV = Wrap;
};

struct VS_INPUT
{
	float3 pos : POSITION;
	float3 normal : NORMAL;
	float2 uv : TEXCOORD;
};

struct VS_OUTPUT
{
	float4 pos : SV_POSITION;
	float2 uv : TEXCOORD;
};

//vertex shader
VS_OUTPUT ModelVS(VS_INPUT vIn)
{
	VS_OUTPUT vOut;
	float4 posH = mul(float4(vIn.pos, 1), mul(model,view));
	posH = mul(posH, proj);

	vOut.pos = posH;
	vOut.uv = vIn.uv;
	return vOut;
}

//pixel shader
float4 ModelPS(VS_OUTPUT pIn) : SV_TARGET
{
	float4 diffuse = gDiffuseTexture.Sample(MeshTextureSampler, pIn.uv);
	return diffuse;
}

technique10 SImpleModel
{
    pass P0
    {
        SetVertexShader( CompileShader( vs_4_0, ModelVS() ) );
		SetGeometryShader( NULL );
        SetPixelShader( CompileShader( ps_4_0, ModelPS() ) );

		SetRasterizerState(SolidDraw);
    }
}